#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QPainter>
#include <QPrinter>
#include <QPrintDialog>
#include <QTextDocumentFragment>
#include <file_util.h>
#include <string>
#include <QString>
#include <QMap>
#include <QHash>
#include <QChar>
using namespace std;
namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT
    
public:
    QString filename;
    int count_code;
    QString name_only;
    bool isNormal;
    int marker_start;
    int marker_end;
    explicit MainWindow(QString str, QWidget *parent = 0);
    ~MainWindow();
    
private slots:

    void on_buttonSave_clicked();
    void on_buttonModeNormal_clicked();
    void on_buttonSaveAs_clicked();
    void auto_save();
    void textEditorChanged();


private:
    Ui::MainWindow *ui;
    QHash<QString,int> imagePositionList;
    QHash<QString,QString> abbreviationList;
    int noteSize;
    bool isTextEditorLoading;
    void createActions();
    void createToolbars();

public slots:
    void addAbbr();
    void createNewNote();
    void openNote();
    void exportPdf();
    void print();
    void insertImage();
};

#endif // MAINWINDOW_H
